package at.fhj.antesk.steamvaluecalc.view;

import java.awt.BorderLayout;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.UIManager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MainWindow {

	private static Logger logger = LoggerFactory.getLogger(MainWindow.class);

	private JFrame frame = new JFrame();
	private JScrollPane tableScrollPane;
	private JTable gameTable;

	public MainWindow() {
		frame.setSize(800, 512);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.getContentPane().setLayout(new BorderLayout());
		
		createGameTable();
		createStatusBar();

		try {
			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
		} catch (Exception e) {
			logger.error("Look and Feel could not be loaded", e);
		}

		frame.validate();
	}

	private void createStatusBar() {
		
	}

	private void createGameTable() {
		gameTable = new JTable();
		tableScrollPane = new JScrollPane(gameTable);
		frame.getContentPane().add(tableScrollPane, BorderLayout.LINE_END);
	}

	public JFrame getFrame() {
		return frame;
	}

	public JTable getGameTable() {
		return gameTable;
	}

}
